<script type="text/javascript">
    function sum_pv(obj){
        var s=0;
        for(var p in obj){
            s+=obj[p];
        }
        return s;
    }
    function fz(a){
        if(a===undefined){
            return 0;
        }else{
            return a;
        }
    }
    $(function() {
        $.getJSON("http://"+window.location.hostname+":50004/pv/<%=cop.item("copid")%>?callback=?",function(data){
            console.log(data);
            d=data.d;
            m=data.m;
            a=data.a;
            d_pv=sum_pv(d);
            d_min=d_pv*0.3;
            d_mouse=d_pv*5;
            m_pv=sum_pv(m);
            a_pv=sum_pv(a);

            $("#d_pv").text(d_pv);
            $("#m_pv").text(m_pv);
            $("#a_pv").text(a_pv);

            $("#d_hv").text("查看 "+fz(d["1"]));
            $("#d_hd").text("下载 "+fz(d["2"]));
            $("#d_pd").text("PDF "+fz(d["3"]));

            $("#m_hv").text("查看 "+fz(m["1"]));
            $("#m_hd").text("下载 "+fz(m["2"]));
            $("#m_pd").text("PDF "+fz(m["3"]));

            $("#a_hv").text("查看 "+fz(a["1"]));
            $("#a_hd").text("下载 "+fz(a["2"]));
            $("#a_pd").text("PDF "+fz(a["3"]));
        });
    });
</script>
<div id="main">
<!--#include file="lib/col1.asp"-->
<!--#include file="lib/col2.asp"-->
  <div id="col3" role="main">
    <div id="col3_content" class="clearfix">
        <div class="subcolumns">
            <h3>预录单访问量</h3>
            <div id="pv">
                <div id="d_div" class="c33l">
                    今日 <span id="d_pv"></span> 次
                    <div class="subcolumns">
                        <div id="d_hv" class="c33l"></div>
                        <div id="d_hd" class="c33l"></div>
                        <div id="d_pd" class="c33r"></div>
                    </div>
                </div>
                <div id="m_div" class="c33l">
                    本月 <span id="m_pv"></span> 次
                    <div class="subcolumns">
                        <div id="m_hv" class="c33l"></div>
                        <div id="m_hd" class="c33l"></div>
                        <div id="m_pd" class="c33r"></div>
                    </div>
                </div>
                <div id="a_div" class="c33r">
                    累计 <span id="a_pv"></span> 次
                    <div class="subcolumns">
                        <div id="a_hv" class="c33l"></div>
                        <div id="a_hd" class="c33l"></div>
                        <div id="a_pd" class="c33r"></div>
                    </div>
                </div>
            </div>
        </div>
    
      <div class="subcolumns">
        <div class="c50l">
      <%if CheckEmployee() then%>
          <h3>报关单同步信息</h3>
          <%
            Set rs = Server.CreateObject("ADODB.Recordset")
            sql = "SELECT *  FROM ul where  ( ul_post=1 and ul_date>=dateadd('d',-3,date())) order by ul_date desc,ul_post asc,id desc"
            rs.Open sql,conn,1,1
            str=""
            t_date=""
            if not rs.eof then str_end="</ol></li></ul></div>" else str_end=""
            do while not rs.eof
              select case rs("ul_post")
                case 0 ul_post="系统"
                case 1 ul_post="同步"
              end select
              if rs("ul_date")<>t_date then 
                t_post=-1
                if t_date<>"" then str=str&"</ul></div>"
                str=str&"<div><h4>"&rs("ul_date")&"</h4><ul>"
                t_date=rs("ul_date")
              end if
              if rs("ul_post")<>t_post then
                if t_post<>-1 then str=str&"</ol></li>"
                str=str&"<li>"&ul_post&"<ol>"
                t_post=rs("ul_post")
              end if
              str=str&"<li>"&rs("ul_cont")&"</li>"
              rs.movenext
            loop
            str=str&str_end
            response.write(str)
            rs.close
            set rs=nothing
          %>
      <%end if%>
        </div>
        <div class="c50r">
          <h3>QP系统公告</h3>
          <iframe id="qpinfo" src="http://122.227.172.219:50004/qpinfo/all?c=10"></iframe>
        </div>
      </div>
    </div>
  </div>
</div>
